﻿@{
    Layout = null;
}

@Content.Script(Url, "Manager/MenuManage.js")
<style>
    .TwoLevelMenu > td:nth-child(1) {
        padding-left: 20px;
    }

    .ThreeLevelMenu > td:nth-child(1) {
        padding-left: 40px;
    }
    table .glyphicon {
        margin-right:5px;
    }
</style>
<div class="mlr15">
    <div style="margin:14px 0">
        <button class="btn btn-success" onclick="$.MGJ.MenuManage.Dialog_AddMenu()">
            <i class="glyphicon glyphicon-plus"></i>
            新增
        </button>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th class="text-center">菜单名称</th>
                <th class="text-center">菜单路径</th>
                <th class="text-center">状态</th>
                <th class="text-center">操作</th>
            </tr>
        </thead>
        <tbody id="MenuInfo" style="display:none;" >
            <tr binding="{'MenuID':'ID'}" class="OneLevelMenu" onclick="$.MGJ.MenuManage.Ajax_GetMenuInfo(this)">
                @*<tr class="OneLevelMenu" >*@
                <td class="text-left">
                    <i class="glyphicon glyphicon-folder-open"></i>
                    <span binding="{'text':'MenuName'}"></span>
                </td>
                <td class="text-center"></td>                
                <td class="text-center State_TF" binding="{'text':'StatusID'}"></td>
                <td class="centerClo text-center">
                     <a binding="{'MenuID':'ID'}" onclick="$.MGJ.MenuManage.Dialog_AddMenu(this, event)">添加子菜单</a>
                    |<a binding="{'MenuID':'ID'}" onclick="$.MGJ.MenuManage.Ajax_DeleteMenuInfo(this,event)">删除</a>
                    |<a binding="{'MenuID':'ID'}" onclick="$.MGJ.MenuManage.Dialog_EditMenu(this,event)">编辑</a>
                </td>
            </tr>
        </tbody>
    </table>
</div>
<script type="text/javascript">
    var ColspanNub = $(".table.table-hover.table-bordered").find("tr").children("td").length
    window.Menu_EmptyHtml = '<tr><td colspan="' + ColspanNub + '"><p class="no-result">无符合条件的数据结果</p></td></tr>';

    $(function () {
        $.MGJ.MenuManage.Ajax_GetMenuInfo(0);
    });
</script>
